package StringTokenizerTest;

import java.util.StringTokenizer;

public class demo02 {
    public static void main(String[] args) {
        String str = "https://blog.csdn.net/qq_45797116?spm=1011.2124.3001.5343";
        StringTokenizer tokenizer = new StringTokenizer(str,".");
        int count = 1;
        while (tokenizer.hasMoreTokens()){
            System.out.println(count+"."+tokenizer.nextToken());
            count++;
        }
        System.out.println("使用分隔符 . 后，共有"+(count-1)+"个。");
    }
}
